/* ----------------------------------------------
Script      : 锁屏天气修改
Author      : yozoo
Version     : 1.0.0
Description : 配合快捷指令使用，请勿添加到桌面
Platform    : 哔哩哔哩「云彩数码」
--------------------------------------------- */
// 快捷指令：
// https://www.icloud.com/shortcuts/778151de68dc466d8e325f79802f99d6
// 设置定位刷新时间 单位：分钟
UPDATA_TIME = 4 * 60;
// 背景蒙版透明 数值范围：0～1
MASK_ALPHA = 0.25
    // 如果天气图标异常，反馈后，把下面的值更改为 false 直到恢复
UPDATA_WEATHER = true

/* ------------------------------------------ */

var arrayss = ["local", "libraryDirectory", "./「大舅哥」开发环境.js", "joinPath", "fileExists", "title", "组件失效", "message", "数据丢失搜索云彩数码下载", "我知道了", "addCancelAction", "presentAlert", "weixin:", "open", "name", "锁屏天气", "iphone", "https://gitee.com/wMadao/lockweather/raw/main/image/phone.png", "weatherDes", "https://gitee.com/wMadao/lockweather/raw/main/scriptable/weatherDes.js", "configs", "晴", "多云", "有雾", "有雨", "雪", "沙", "沙暴", "Rindy", "sun.max.fill", "moon.stars.fill", "cloud.sun.fill", "cloud.moon.fill", "cloud.fill", "sun.haze.fill", "cloud.drizzle.fill", "cloud.rain.fill", "cloud.heavyrain.fill", "cloud.fog.fill", "cloud.snow.fill", "sun.dust.fill", "smoke.fill", "wind", "runsInApp", "getLocation", "LIGHT_RAIN", "22", "11", "23", "10", "00", "01", "02", "03", "9", "04", "05", "23°", "周日", "多云", "19°", "周一", "22°", "周二", "周三", "阵雨", "25°", "周四", "27°", "周五", "局部雷暴雨", "周六", "深圳市", "shortcutParameter", "https://api.caiyunapp.com/v2.5/", "key", "/", "longitude", ",", "latitude", "/hourly.json", "httpGet", "weather", "value", "skycon", "hourly", "result", "tempData", "time", "match", "datetime", "push", "forEach", "splice", "temperature", "nowTemp", " ", "split", "city", "length", "", "replace", "getTime", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日", "date", "temp", "C", "week", "indexOf", "oneWeek", "sort", "getWeather", "a", "b", "c", "https://gitee.com/wMadao/lockweather/raw/main/image/triangle_up.png", "https://gitee.com/wMadao/lockweather/raw/main/image/triangle_down.png", "makeCanvas", "addRoundedRect", "closeSubpath", "#000", "setFillColor", "addPath", "fillPath", "getSFSymbol", "drawImageAtPoint", "systemFont", "drawText", "weatherDesc", "未来8小时", "°", "0", "padStart", "getHours", "getMinutes", "更新于 ", ":", "#fff", "drawLineGraphs", "现在", "本周天气", "getImage", "weatherSFIcos", "weatherSF", "named", "applyFont", "image", "getImageByUrl", "size", "#008b8b", "width", "height", "fillRect", "present", "toBase64String", "fromPNG", "setShortcutOutput", "undefined", "log", "删除", "版本号，js会定", "期弹窗，", "还请支持我们的工作", "jsjia", "mi.com"];
FILE = FileManager[arrayss[0x0]]();
FILE_PATH = FILE[arrayss[0x3]](FILE[arrayss[0x1]](), arrayss[0x2]);
if (!FILE[arrayss[0x4]](FILE_PATH)) {
    let at = new Alert();
    at[arrayss[0x5]] = arrayss[0x6], at[arrayss[0x7]] = arrayss[0x8], at[arrayss[0xa]](arrayss[0x9]);
    let pat = await at[arrayss[0xb]]();
    if (pat === 0) {
        Safari[arrayss[0xd]](arrayss[0xc])
    };
    return ![]
};
const {
    DJG
} = importModule(FILE_PATH);
class Drawing extends DJG {
    constructor(_0xf08dx4) {
        super(_0xf08dx4);
        this[arrayss[0xe]] = arrayss[0xf];
        this[arrayss[0x10]] = arrayss[0x11];
        this[arrayss[0x12]] = arrayss[0x13];
        this[arrayss[0x14]] = {
            weatherDesc: {
                CLEAR_DAY: arrayss[0x15],
                CLEAR_NIGHT: arrayss[0x15],
                PARTLY_CLOUDY_DAY: arrayss[0x16],
                PARTLY_CLOUDY_NIGHT: arrayss[0x16],
                CLOUDY: arrayss[0x16],
                CLOUDY_NIGHT: arrayss[0x16],
                LIGHT_HAZE: arrayss[0x17],
                LIGHT_HAZE_NIGHT: arrayss[0x17],
                MODERATE_HAZE: arrayss[0x17],
                MODERATE_HAZE_NIGHT: arrayss[0x17],
                HEAVY_HAZE: arrayss[0x17],
                HEAVY_HAZE_NIGHT: arrayss[0x17],
                LIGHT_RAIN: arrayss[0x18],
                MODERATE_RAIN: arrayss[0x18],
                HEAVY_RAIN: arrayss[0x18],
                STORM_RAIN: arrayss[0x18],
                FOG: arrayss[0x17],
                LIGHT_SNOW: arrayss[0x19],
                MODERATE_SNOW: arrayss[0x19],
                HEAVY_SNOW: arrayss[0x19],
                STORM_SNOW: arrayss[0x19],
                DUST: arrayss[0x1a],
                SAND: arrayss[0x1b],
                WIND: arrayss[0x1c]
            },
            weatherSFIcos: {
                CLEAR_DAY: arrayss[0x1d],
                CLEAR_NIGHT: arrayss[0x1e],
                PARTLY_CLOUDY_DAY: arrayss[0x1f],
                PARTLY_CLOUDY_NIGHT: arrayss[0x20],
                CLOUDY: arrayss[0x21],
                CLOUDY_NIGHT: arrayss[0x21],
                LIGHT_HAZE: arrayss[0x22],
                LIGHT_HAZE_NIGHT: arrayss[0x22],
                MODERATE_HAZE: arrayss[0x22],
                MODERATE_HAZE_NIGHT: arrayss[0x22],
                HEAVY_HAZE: arrayss[0x22],
                HEAVY_HAZE_NIGHT: arrayss[0x22],
                LIGHT_RAIN: arrayss[0x23],
                MODERATE_RAIN: arrayss[0x23],
                HEAVY_RAIN: arrayss[0x24],
                STORM_RAIN: arrayss[0x25],
                FOG: arrayss[0x26],
                LIGHT_SNOW: arrayss[0x27],
                MODERATE_SNOW: arrayss[0x27],
                HEAVY_SNOW: arrayss[0x27],
                STORM_SNOW: arrayss[0x27],
                DUST: arrayss[0x28],
                SAND: arrayss[0x29],
                WIND: arrayss[0x2a]
            }
        }
    }
    async getWeather() {
        let _0xf08dx6;
        if (config[arrayss[0x2b]]) {
            _0xf08dx6 = await this[arrayss[0x2c]](UPDATA_TIME)
        } else {
            _0xf08dx6 = await this[arrayss[0x2c]](UPDATA_TIME, false)
        };
        let _0xf08dx7 = {
            "weather": arrayss[0x2d],
            "tempData": [{
                "time": arrayss[0x2e],
                "value": arrayss[0x2f]
            }, {
                "time": arrayss[0x30],
                "value": arrayss[0x31]
            }, {
                "time": arrayss[0x32],
                "value": arrayss[0x31]
            }, {
                "time": arrayss[0x33],
                "value": arrayss[0x31]
            }, {
                "time": arrayss[0x34],
                "value": arrayss[0x31]
            }, {
                "time": arrayss[0x35],
                "value": arrayss[0x36]
            }, {
                "time": arrayss[0x37],
                "value": arrayss[0x31]
            }, {
                "time": arrayss[0x38],
                "value": arrayss[0x31]
            }],
            "nowTemp": arrayss[0x2f]
        };
        let _0xf08dx8 = [{
            "temp": arrayss[0x39],
            "week": arrayss[0x3a],
            "weather": arrayss[0x3b]
        }, {
            "temp": arrayss[0x3c],
            "week": arrayss[0x3d],
            "weather": arrayss[0x3b]
        }, {
            "temp": arrayss[0x3e],
            "week": arrayss[0x3f],
            "weather": arrayss[0x3b]
        }, {
            "temp": arrayss[0x3e],
            "week": arrayss[0x40],
            "weather": arrayss[0x41]
        }, {
            "temp": arrayss[0x42],
            "week": arrayss[0x43],
            "weather": arrayss[0x41]
        }, {
            "temp": arrayss[0x44],
            "week": arrayss[0x45],
            "weather": arrayss[0x46]
        }, {
            "temp": arrayss[0x3e],
            "week": arrayss[0x47],
            "weather": arrayss[0x41]
        }];
        let _0xf08dx9 = arrayss[0x48];
        const _0xf08dxa = new Date();
        let _0xf08dxb = args[arrayss[0x49]];
        if (_0xf08dxb) {
            const _0xf08dxc = `${arrayss[0x4a]}${_0xf08dxb[arrayss[0x4b]]}${arrayss[0x4c]}${_0xf08dx6[arrayss[0x4d]]}${arrayss[0x4e]}${_0xf08dx6[arrayss[0x4f]]}${arrayss[0x50]}`;
            let _0xf08dxd = await this[arrayss[0x51]](_0xf08dxc);
            _0xf08dx7[arrayss[0x52]] = _0xf08dxd[arrayss[0x56]][arrayss[0x55]][arrayss[0x54]][0x0][arrayss[0x53]];
            _0xf08dx7[arrayss[0x57]] = [];
            _0xf08dxd[arrayss[0x56]][arrayss[0x55]][arrayss[0x5e]][arrayss[0x5d]](0, 8)[arrayss[0x5c]](function(_0xf08dxe, _0xf08dxf) {
                let _0xf08dx10 = {};
                _0xf08dx10[arrayss[0x58]] = _0xf08dxe[arrayss[0x5a]][arrayss[0x59]](/T(\d*):/)[0x1];
                _0xf08dx10[arrayss[0x53]] = String(parseInt(_0xf08dxe[arrayss[0x53]]));
                _0xf08dx7[arrayss[0x57]][arrayss[0x5b]](_0xf08dx10)
            });
            _0xf08dx7[arrayss[0x5f]] = _0xf08dx7[arrayss[0x57]][0x0][arrayss[0x53]];
            let _0xf08dx11 = _0xf08dxb[arrayss[0x62]][arrayss[0x61]](arrayss[0x60]);
            for (let _0xf08dx12 in _0xf08dx11) {
                const _0xf08dx13 = RegExp(/省|市|壮族自治区|回族自治区|自治州|维吾尔自治区|自治区|区/g);
                const _0xf08dx14 = _0xf08dx11[_0xf08dx12][arrayss[0x59]](_0xf08dx13);
                if (_0xf08dx14) {
                    for (let _0xf08dxf in _0xf08dx14) {
                        if ((_0xf08dx11[_0xf08dx12][arrayss[0x63]] - _0xf08dx14[_0xf08dxf][arrayss[0x63]]) === 3) {
                            _0xf08dx9 = _0xf08dx11[_0xf08dx12][arrayss[0x65]](_0xf08dx14[_0xf08dxf], arrayss[0x64])
                        };
                        if ((_0xf08dx11[_0xf08dx12][arrayss[0x63]] - _0xf08dx14[_0xf08dxf][arrayss[0x63]]) === 2 && _0xf08dx14[_0xf08dxf][arrayss[0x63]] == 1) {
                            _0xf08dx9 = _0xf08dx11[_0xf08dx12]
                        }
                    }
                }
            };
            _0xf08dx8 = [];
            const _0xf08dx15 = _0xf08dxa[arrayss[0x66]]();
            const _0xf08dx16 = [arrayss[0x67], arrayss[0x68], arrayss[0x69], arrayss[0x6a], arrayss[0x6b], arrayss[0x6c], arrayss[0x6d]];
            const _0xf08dx17 = [arrayss[0x3d], arrayss[0x3f], arrayss[0x40], arrayss[0x43], arrayss[0x45], arrayss[0x47], arrayss[0x3a]];
            _0xf08dxb[arrayss[0x73]][arrayss[0x5c]](function(_0xf08dxe, _0xf08dxf) {
                let _0xf08dx18 = _0xf08dxe[arrayss[0x6e]][arrayss[0x61]](arrayss[0x60]);
                let _0xf08dx19 = {};
                _0xf08dx19[arrayss[0x6e]] = new Date(_0xf08dx18[0x0])[arrayss[0x66]]();
                _0xf08dx19[arrayss[0x6f]] = _0xf08dxe[arrayss[0x6f]][arrayss[0x61]](arrayss[0x70])[0x0];
                _0xf08dx19[arrayss[0x71]] = _0xf08dx17[_0xf08dx16[arrayss[0x72]](_0xf08dx18[0x1])];
                _0xf08dx19[arrayss[0x52]] = _0xf08dxe[arrayss[0x52]];
                _0xf08dx8[arrayss[0x5b]](_0xf08dx19)
            });
            _0xf08dx8[arrayss[0x74]](function(_0xf08dx1a, _0xf08dx1b) {
                return _0xf08dx1a[arrayss[0x6e]] - _0xf08dx1b[arrayss[0x6e]]
            })
        };
        return {
            a: _0xf08dx7,
            b: _0xf08dx8,
            c: _0xf08dx9
        }
    }
    async Drawing() {
        const _0xf08dx1d = await this[arrayss[0x75]]();
        const _0xf08dx7 = _0xf08dx1d[arrayss[0x76]];
        const _0xf08dx8 = _0xf08dx1d[arrayss[0x77]];
        const _0xf08dx9 = _0xf08dx1d[arrayss[0x78]];
        const _0xf08dxa = new Date();
        const _0xf08dx1e = {
            up: arrayss[0x79],
            down: arrayss[0x7a]
        };
        const _0xf08dx1f = {
            "width": 1125,
            "height": 2436
        };
        const _0xf08dx20 = this[arrayss[0x7b]](_0xf08dx1f);
        const _0xf08dx21 = new Path();
        const _0xf08dx22 = new Rect(0, 1130, 1125, 1320);
        _0xf08dx21[arrayss[0x7c]](_0xf08dx22, 80, 80);
        _0xf08dx21[arrayss[0x7d]]();
        _0xf08dx20[arrayss[0x7f]](new Color(arrayss[0x7e], MASK_ALPHA));
        _0xf08dx20[arrayss[0x80]](_0xf08dx21);
        _0xf08dx20[arrayss[0x81]]();
        let _0xf08dx23 = await this[arrayss[0x82]](_0xf08dx7[arrayss[0x52]], 120, true);
        _0xf08dx20[arrayss[0x83]](_0xf08dx23, new Point(52, 1180));
        this[arrayss[0x85]](_0xf08dx20, 238, 1190, 300, 80, _0xf08dx9, Font[arrayss[0x84]](55));
        this[arrayss[0x85]](_0xf08dx20, 238, 1270, 300, 80, this[arrayss[0x14]][arrayss[0x86]][_0xf08dx7[arrayss[0x52]]], Font[arrayss[0x84]](40));
        this[arrayss[0x85]](_0xf08dx20, 52, 1335, 400, 80, arrayss[0x87], Font[arrayss[0x84]](60));
        this[arrayss[0x85]](_0xf08dx20, 912, 1195, 150, 100, `${arrayss[0x64]}${_0xf08dx7[arrayss[0x5f]]}${arrayss[0x88]}`, Font[arrayss[0x84]](96));
        const _0xf08dx24 = _0xf08dxa[arrayss[0x8b]]().toString()[arrayss[0x8a]](2, arrayss[0x89]);
        const _0xf08dx25 = _0xf08dxa[arrayss[0x8c]]().toString()[arrayss[0x8a]](2, arrayss[0x89]);
        this[arrayss[0x85]](_0xf08dx20, 808, 1359, 350, 50, `${arrayss[0x8d]}${_0xf08dx24}${arrayss[0x8e]}${_0xf08dx25}${arrayss[0x64]}`, Font[arrayss[0x84]](35));
        const _0xf08dx26 = {
            width: 1041,
            height: 160
        };
        let _0xf08dx27 = 50;
        let _0xf08dx28 = 0;
        let _0xf08dx29 = [];
        _0xf08dx7[arrayss[0x57]][arrayss[0x5c]](function(_0xf08dxe) {
            let _0xf08dx2a = parseInt(_0xf08dxe[arrayss[0x53]][arrayss[0x61]](arrayss[0x88])[0x0]);
            _0xf08dx29[arrayss[0x5b]](_0xf08dx2a);
            if (_0xf08dx2a > _0xf08dx28) {
                _0xf08dx28 = _0xf08dx2a
            };
            if (_0xf08dx2a < _0xf08dx27) {
                _0xf08dx27 = _0xf08dx2a
            }
        });
        const _0xf08dx2b = _0xf08dx28 - _0xf08dx27;
        const _0xf08dx2c = _0xf08dx2b == 0 ? 0 : 80 / _0xf08dx2b;
        _0xf08dx29[arrayss[0x5c]](function(_0xf08dxe, _0xf08dxf) {
            const _0xf08dx2d = _0xf08dxe - _0xf08dx27;
            const _0xf08dx2e = _0xf08dx2d * _0xf08dx2c + _0xf08dxe;
            _0xf08dx29[_0xf08dxf] = _0xf08dx2e
        });
        for (let _0xf08dx12 in _0xf08dx29) {
            if (_0xf08dx12 != _0xf08dx29[arrayss[0x63]] - 1) {
                this[arrayss[0x85]](_0xf08dx20, 43 + _0xf08dx12 * 148, 1553 - _0xf08dx29[_0xf08dx12], 350, 40, `${arrayss[0x64]}${_0xf08dx7[arrayss[0x57]][_0xf08dx12][arrayss[0x53]]}${arrayss[0x88]}`, Font[arrayss[0x84]](30))
            } else {
                this[arrayss[0x85]](_0xf08dx20, 13 + _0xf08dx12 * 148, 1553 - _0xf08dx29[_0xf08dx12], 350, 40, `${arrayss[0x64]}${_0xf08dx7[arrayss[0x57]][_0xf08dx12][arrayss[0x53]]}${arrayss[0x88]}`, Font[arrayss[0x84]](30))
            }
        };
        const _0xf08dx2f = await this[arrayss[0x90]](_0xf08dx29, _0xf08dx26, 30, arrayss[0x8f], 0.3);
        _0xf08dx20[arrayss[0x83]](_0xf08dx2f, new Point(45, 1475));
        const _0xf08dx10 = _0xf08dx7[arrayss[0x57]];
        for (let _0xf08dxf = 0; _0xf08dxf < _0xf08dx10[arrayss[0x63]]; _0xf08dxf++) {
            if (_0xf08dxf == 0) {
                this[arrayss[0x85]](_0xf08dx20, 23 + _0xf08dxf * 148, 1650, 350, 40, arrayss[0x91], Font[arrayss[0x84]](30))
            } else {
                this[arrayss[0x85]](_0xf08dx20, 23 + _0xf08dxf * 148, 1650, 350, 40, _0xf08dx10[_0xf08dxf][arrayss[0x58]], Font[arrayss[0x84]](30))
            }
        };
        this[arrayss[0x85]](_0xf08dx20, 50, 1728, 350, 65, arrayss[0x92], Font[arrayss[0x84]](60));
        for (let _0xf08dxf = 0; _0xf08dxf < _0xf08dx8[arrayss[0x63]]; _0xf08dxf++) {
            this[arrayss[0x85]](_0xf08dx20, 49 + _0xf08dxf * 157, 1828, 120, 65, _0xf08dx8[_0xf08dxf][arrayss[0x71]], Font[arrayss[0x84]](40));
            _0xf08dx23 = await this[arrayss[0x82]](_0xf08dx8[_0xf08dxf][arrayss[0x52]], 60);
            _0xf08dx20[arrayss[0x83]](_0xf08dx23, new Point(48 + _0xf08dxf * 158, 1907));
            this[arrayss[0x85]](_0xf08dx20, 53 + _0xf08dxf * 158, 2010, 120, 50, _0xf08dx8[_0xf08dxf][arrayss[0x6f]], Font[arrayss[0x84]](42))
        };
        return _0xf08dx20[arrayss[0x93]]()
    }
    async getSFSymbol(_0xf08dx31, _0xf08dx1f, _0xf08dx32 = false) {
        if (_0xf08dx32) {
            _0xf08dx31 = this[arrayss[0x14]][arrayss[0x94]][_0xf08dx31]
        } else {
            const _0xf08dx33 = await this[arrayss[0x51]](this[arrayss[0x12]], UPDATA_WEATHER);
            _0xf08dx31 = _0xf08dx33[arrayss[0x95]][_0xf08dx31]
        }; if (!_0xf08dx31) {
            _0xf08dx31 = arrayss[0x21]
        };
        const _0xf08dx34 = SFSymbol[arrayss[0x96]](_0xf08dx31);
        if (_0xf08dx34 != null) {
            if (_0xf08dx1f != undefined && _0xf08dx1f != null) {
                _0xf08dx34[arrayss[0x97]](Font[arrayss[0x84]](_0xf08dx1f))
            };
            return _0xf08dx34[arrayss[0x98]]
        } else {
            return undefined
        }
    }
    async Run() {
        const _0xf08dx36 = await this.Drawing();
        if (config[arrayss[0x2b]]) {
            const _0xf08dx37 = await this[arrayss[0x99]](this[arrayss[0x10]]);
            const _0xf08dx1f = _0xf08dx37[arrayss[0x9a]];
            const _0xf08dx20 = this[arrayss[0x7b]](_0xf08dx1f);
            _0xf08dx20[arrayss[0x7f]](new Color(arrayss[0x9b]));
            _0xf08dx20[arrayss[0x9e]](new Rect(0, 0, _0xf08dx1f[arrayss[0x9c]], _0xf08dx1f[arrayss[0x9d]]));
            _0xf08dx20[arrayss[0x83]](_0xf08dx36, new Point(93, 60));
            _0xf08dx20[arrayss[0x83]](_0xf08dx37, new Point(0, 0));
            QuickLook[arrayss[0x9f]](_0xf08dx20[arrayss[0x93]](), false)
        } else {
            const _0xf08dx38 = Data[arrayss[0xa1]](_0xf08dx36)[arrayss[0xa0]]();
            Script[arrayss[0xa2]](_0xf08dx38)
        }
    }
};
await(new Drawing()).Run();